import request from '@/utils/request.js'

// 获取所有酒店列表
export const getHotelsService = () => {
  return request.get('/hotels');
}

// 获取酒店详情
export const getHotelByNameService = (name) => {
  return request.get('/hotels/' + name);
}

//添加酒店
export const addHotelService = (data) => {
  return request.post('/hotels', data);
}

//删除酒店
export const deleteHotelService = (name) => {
  return request.delete('/hotels/' + name);
}

//更新酒店
export const updateHotelService = (data) => {
  return request.put('/hotels', data);
}

//查询所有酒店房间
export const getAllHotelRoomsService = () => {
  return request.get('/hotels/rooms');
}

//查询酒店房间列表
export const getHotelRoomsService = (name) => {
  return request.get('/hotels/rooms/' + name);
}

//查询单个酒店房间信息
export const getHotelRoomByNumberService = (name, roomNumber) => {
  return request.get('/hotels/rooms/' + name + '/' + roomNumber);
}

//添加酒店房间
export const addHotelRoomService = (hotelName, data) => {
  return request.post('/hotels/rooms/'+hotelName, data);
}

//删除酒店房间
export const deleteHotelRoomService = (name, roomNumber) => {
  return request.delete('/hotels/rooms/' + name + '/' + roomNumber);
}


//更新酒店房间
export const updateHotelRoomService = (hotelName, roomNumber, data) => {
  return request.put('/hotels/rooms/' + hotelName + '/' + roomNumber, data);
}